package constant.milk.cashbook.insert;

import constant.milk.cashbook.R;
import constant.milk.cashbook.SuperActivity;
import constant.milk.cashbook.tip.TipMap;
import constant.milk.cashbook.tip.TipInfoActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class InsertActivity extends SuperActivity
{
	public static final String INSERT_TYPE = "INSERT_TYPE";
	
	public static final String REALMONEY = "0";
	public static final String BANKBOOK = "1";
	public static final String CHECKCARD = "2";
	public static final String CREDITCARD = "3";
	public static final String PHONE = "4";
	public static final String GIFTCARD = "5";

	public static final int INSERT_OUT = 0;
	public static final int INSERT_IN = 1;
	
	private View outView;
	private View inView;
	private View moveView;
	private View fanView;
	private View giftCardView;
	private View resultView;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.insert_main_activity);
		
		setTitle("입력");
		
		setFindViewId();
		setOnClick();
		setData();
	}

	@Override
	protected void setFindViewId()
	{
		outView = findViewById(R.id.insertMainOutView);
		inView = findViewById(R.id.insertMainInView);
		moveView = findViewById(R.id.insertMainMoveView);
		fanView = findViewById(R.id.insertMainFanView);
		giftCardView = findViewById(R.id.insertMainGiftCardView);
		resultView = findViewById(R.id.insertMainResultMoneyView);
	}

	@Override
	protected void setOnClick()
	{
		outView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertNormalActivity.class);
				intent.putExtra(INSERT_TYPE, INSERT_OUT);
				startActivity(intent);
			}
		});
		
		inView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertNormalActivity.class);
				intent.putExtra(INSERT_TYPE, INSERT_IN);
				startActivity(intent);
			}
		});
		
		moveView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertMoveActivity.class);
				startActivity(intent);
			}
		});
		
		fanView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertFanActivity.class);
				intent.putExtra(InsertFanActivity.INSERT_TYPE, InsertFanActivity.FAN_IN_OUT);
				startActivity(intent);
			}
		});
		
		giftCardView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertGiftCardActivity.class);
				startActivity(intent);
			}
		});
		
		resultView.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(superContext, InsertResultActivity.class);
				startActivity(intent);
			}
		});
	}

	@Override
	protected void setData()
	{
	}

	@Override
	protected void tipButton()
	{
		Intent intent = new Intent(superContext, TipInfoActivity.class);
		intent.putExtra(TipInfoActivity.TIP_ID, TipMap.TIP_INSERT);
		startActivity(intent);
	}

}
